<?php


namespace App\Helpers\WatchDog\LarkBot;

use App\Helpers\WatchDog\Message;
use App\Helpers\WatchDog\Messages;

/**
 * 飞书：消息助手类
 *
 * @link    https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot
 *
 * Class LarkBotHelper
 *
 * @package App\Helpers\WatchDog\LarkBot
 * @author  kingsg
 */
class LarkBotHelper extends Messages implements Message
{

	// host
	protected static string $watchDogHost = 'https://open.feishu.cn/open-apis/bot/v2/hook';

	/**
	 * 设置url
	 */
	public static function getUrl(): string
	{
		return static::$watchDogHost . '/' . static::getAccessToken();
	}

	/**
	 * text类型
	 *
	 * @param string $content
	 */
	public static function sendText(string $content)
	{
		$msg = [
			'msg_type' => 'text',
			'content'  => [
				'text' => $content,
			],
		];

		static::sendMsg($msg);
	}


}